var initShopInfoSearchPage = function(){
	jQuery('#ligerStateSearcher').ligerComboBox({
		data:userStateRenderData,
		valueField:'value',
		textField:'text',
		initValue:userStateRenderData[0].value,
		valueFieldID:'stateSearcher'
	});
	jQuery('#ligerRoleIdSearcher').ligerComboBox({
		data:rolesJson,
		valueField:'id',
		textField:'name',
		initValue:rolesJson[0].value,
		valueFieldID:'roleIdSearcher'
	});
};

var getShopInfoSearchParams = function(){
	var shopinfoBean = {};
	var temp;
	temp = jQuery('#nameSearcher').val();
	if(temp){
		shopinfoBean.name = temp;
	}
	temp = jQuery('#masterNameSearcher').val();
	if(temp){
		shopinfoBean.masterName = temp;
	}
	temp = jQuery('#masterCardSearcher').val();
	if(temp){
		shopinfoBean.masterCard = temp;
	}
	temp = jQuery('#emailSearcher').val();
	if(temp){
		shopinfoBean.email = temp;
	}
	temp = jQuery('#phoneSearcher').val();
	if(temp){
		shopinfoBean.phone = temp;
	}
	temp = jQuery('#addressSearcher').val();
	if(temp){
		shopinfoBean.address = temp;
	}
	temp = jQuery('#registerTimeBegin').val();
	if(temp){
		shopinfoBean.registerTimeBegin =  new Date(Date.parse((temp+":00").replace(/-/g,   "/")));
	}
	temp = jQuery('#registerTimeEnd').val();
	if(temp){
		shopinfoBean.registerTimeEnd =  new Date(Date.parse((temp+":00").replace(/-/g,   "/")));
	}
	temp = jQuery('#stateSearcher').val();
	if(temp){
		shopinfoBean.state = temp;
	}
	temp = jQuery('#passwdSearcher').val();
	if(temp){
		shopinfoBean.passwd = temp;
	}
	temp = jQuery('#roleIdSearcher').val();
	if(temp){
		shopinfoBean.roleId = temp;
	}
	return shopinfoBean;
}

jQuery(function(){
	initShopInfoSearchPage();
	jQuery('#searchShopInfo').click(function(){
		shopinfoManager.loadServerData(getShopInfoSearchParams());
	});
});


